package com.nf.action;

import com.nf.service.UserService;
import com.opensymphony.xwork2.ActionSupport;

public class UserAction extends ActionSupport{

    //需要调用Service 就定义UserService接口为属性
    private UserService userService=null;
    public UserService getUserService(){
        return userService;
    }
    public void setUserService(UserService userService){

        this.userService=userService;
    }
    @Override
    public String execute() throws Exception{
        String userName=userService.getUserNameById("123");
        System.out.println(userName);
        return this.NONE;
    }
}
